import request from '@/utils/request'
export const listMember = (search) => 
    request({
        url: '/member/listAllMember',
        method: 'get',
        params: {
            name: search.name,
            sort: search.sort,
            offset: search.offset,
            limit: search.limit
        }
    })
export const getMember = (id) => 
    request({
        url: '/member/getMember',
        method: 'get',
        params: {
            id:id
        }
    })
export const addMember = (search) => 
    request({
        url: '/member/addMember',
        method: 'post',
        data:search
    })

export const updateMember = (model) => 
    request({
        url: '/member/updateMember',
        method: 'post',
        data:model
    })
    
export const deleteMember = (id) => 
request({
    url: '/member/deleteMember',
    method: 'post',
    params: {
        id:id
    }
})

export const findMember = (idCard) => 
request({
    url: '/member/getMemberByIdCard',
    method: 'get',
    params: {
        idCard:idCard
    }
})

export const statistics = (search) => 
request({
    url: '/member/statistics',
    method: 'get',
    params: {
        name: search.name,
        sort: search.sort,
        offset: search.offset,
        limit: search.limit,
        startTime:search.value1,
        endTime:value2
    }
})